<?php
namespace app\api\controller;
use think\Controller;

class Slide extends Controller
{
    public function index() 
    {
        $data = db('slide')->select();
        foreach ($data as $k => $v) {
            //dump($v['image']);
            $data[$k]['image'] = $_SERVER['DOCUMENT_ROOT'] . $v['image'];
        }
        
        if ($data) {
            return ['code'=>200,'message'=>'获取成功','data'=>$data];
        }else{
            return ['code'=>400,'message'=>'获取失败','data'=>$data];
        }

    }

}